package SiTuQingYou.servlet;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import SiTuQingYou.dao.CommentDao;
import SiTuQingYou.dao.StrategyDao;
import SiTuQingYou.vo.Strategy;

/**
 * Servlet implementation class StratrhomeServlet
 */
@WebServlet("/StratrhomeServlet")
public class StratrhomeServlet extends BaseAction {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public StratrhomeServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	@Override
	protected void doDefault(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		
	}
	
	protected void deletecom(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		 int id = Integer.parseInt(req.getParameter("cid"));
		 CommentDao.getcd().deletecom(id);
	}
	protected void checkall(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		String name =req.getParameter("key");
		ArrayList<Strategy> str = StrategyDao.getsd().checkall(name);
		req.setAttribute("checkall", str);
	}
	

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */

}
